func (t *WxCardUserCardService) CardGetCardEventHandler(weappid string, mixedMsg *core.MixedMsg) (*WxCardUserCard, error) {
	msg := wxcard.GetUserGetCardEvent(mixedMsg)
	//weappid := msg.AppId
	cardid := msg.CardId
	cardcode := msg.UserCardCode

	s := lego.NewDBSession()
	defer s.Close()
	_ = s.Begin()

	usercard := t.tbWxCardUserCard.ReocodeByWeappIdCardIdAndCardCodeWithsession(s.GetSession(), weappid, cardid, cardcode)
	if usercard != nil {
		s.Rollback()
		return usercard, nil
	}

	rc := NewWxCardUserCardByGetCardEvent(weappid, msg)
	isSuccess := t.tbWxCardUserCard.AddRecodeWithsession(s.GetSession(), rc)
	if !isSuccess {
		s.Rollback()
		return nil, errors.New("tbWxCardUserCard.AddRecodeWithsession failed")
	}

	s.Commit()

	return rc, nil
}